package com.hu.hutool.common;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author CazCen
 * @Date 2022/1/16 12:54
 */

@ConfigurationProperties(prefix = "aliyun.oss.file")
@Component
@Data
public class CssConstantProperties implements InitializingBean{

//    aliyun.oss.file.endpoint=oss-cn-shenzhen.aliyuncs.com
//    aliyun.oss.file.accessKeyId=LTAI5tMyewsCYUvuX5qj4LkF
//    aliyun.oss.file.accessKeySecret=acObA4GPwQdHdIXQXQPqymiX3Tt47Q
//    aliyun.oss.file.bucketname=buket-name
//    aliyun.oss.file.bucketHost=buket-name.oss-cn-shenzhen.aliyuncs.com


    private String endpoint;

    private String accessKeyId;

    private String accessKeySecret;

    private String bucketName;

    private String bucketHost;

    public static String END_POINT;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String BUCKET_NAME;
    public static String BUCKET_HOST;

    @Override
    public void afterPropertiesSet() throws Exception {
        END_POINT = this.endpoint;
        ACCESS_KEY_ID = this.accessKeyId;
        ACCESS_KEY_SECRET = this.accessKeySecret;
        BUCKET_NAME = this.bucketName;
        BUCKET_HOST = this.bucketHost;
    }
}
